
const baseURL = 'http://192.168.1.88:20005'   //域名
const header = {	//请求头
	'content-type': 'application/json;charset=UTF-8'
}
const method = 'post'	//请求方法

//请求封装
function sendRequest(url, data,header) {
	var promise = new Promise(function(resolve, reject) {
		uni.request({
			url: baseURL + url,
			method: method,
			data: data,
			header: header,
			success: function(res) {
				resolve(res)
			},
			fail: function(res) {
				reject('网络出错')
			},
		})
	})
	return promise;
}
module.exports.sendRequest = sendRequest